The TimeValue and Time functions are equivalent to CTime. However, Time can only be used in Crystal syntax since it is a type name in Basic syntax.
Returns a Time value that represents the time, given a String expression specifying a time from 0:00:00 (12:00:00 A.M.) to 23:59:59 (11:59:59 P.M.), inclusive. | |
CTime (number) converts the given number to a Time value; the given number is in units of 24 hours, can be fractional or negative as well.
CTime (string) converts and returns a time given a string that identifies a Time value.
CTime (dateTime) converts and returns a time given a DateTime value.
CTime (hh, mm, ss) converts and returns a time given the arguments of the hour, minute and seconds.
The following examples are applicable to both Basic and Crystal syntax:
Both return the same value 4:48:00 a.m.
CTime (#Feb. 24, 1999 2:40pm#)
You can use the IsTime function to check if a String argument can be converted to a Time before doing the actual conversion. That way, if the conversion cannot be done, you can handle the situation appropriately.
TimeSerial (hour, minute, second)
Seagate Software IMG Holdings, Inc. http://www.seagatesoftware.com Support services: http://support.seagatesoftware.com |